<head>
    <meta charset="UTF-8">
<title>算法训练 Sticks</title>
<link rel="stylesheet" href="../css/main.css">
</head>
 <div class="ptt" lang="en-US" style="font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold; color: blue; text-align: justify;">Sticks</div>
<div class="plm" style="text-align: center; font-family: Arial, Helvetica, sans-serif; font-size: medium;">
<table align="center">
    <tbody>
        <tr>
            <td><b>Time Limit:</b>&nbsp;1000MS</td>
            <td width="10px">&nbsp;</td>
            <td><b>Memory Limit:</b>&nbsp;10000K</td>
        </tr>
        <tr>
            <td><b>Total Submissions:</b>&nbsp;113547</td>
            <td width="10px">&nbsp;</td>
            <td><b>Accepted:</b>&nbsp;26078</td>
        </tr>
    </tbody>
</table>
</div>
<p class="pst" style="font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold; color: blue;">Description</p>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had originally and how long they were originally. Please help him and design a program which computes the smallest possible original length of those sticks. All lengths expressed in units are integers greater than zero.</div>
<p class="pst" style="font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold; color: blue;">Input</p>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">The input contains blocks of 2 lines. The first line contains the number of sticks parts after cutting, there are at most 64 sticks. The second line contains the lengths of those parts separated by the space. The last line of the file contains zero.</div>
<p class="pst" style="font-family: Arial, Helvetica, sans-serif; font-size: 18pt; font-weight: bold; color: blue;">Output</p>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">The output should contains the smallest possible length of original sticks, one per line.</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">&nbsp;</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">sample input</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">&nbsp;9</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">5 2 1 5 2 1 5 2 1</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">4</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">1 2 3 4</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">0</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">sample output</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">5</div>
<div class="ptx" lang="en-US" style="font-family: 'Times New Roman', Times, serif; font-size: medium;">6</div>